﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp1
{
    public class Compute
    {
       
        //加法
        internal double Add(double num1, double num2)
        {
            return num1 + num2;
        }
        //字符串相加
        internal string Adds(string s1, string s2)
        {
            return s1 + s2;
        }
        //减法
        internal double Minus(double num1, double num2)
        {
            return num1 - num2;
        }
        //乘法
        internal double Multiply(double num1, double num2)
        {
            return num1 * num2;
        }
        //除法
        internal double Divide(double num1, double num2)
        {
            return num1 / num2;
        }
        // 取余
        internal double y(double num1, double num2)
        {
            return num1 % num2;
        }
        //判断
        internal double cs(double num2)
        {
            if(num2==0)
            {
                Console.Write("除数不能为0请重新输入第二个数：");
                num2 = double.Parse(Console.ReadLine());
                return num2;
            }
            else
            {
                return num2;
            }
        }

    }
}
